﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RaisingStudio.Data.Entities
{
    public partial class _SystemUserB : RaisingStudio.Data.Expressions.TableExpression, RaisingStudio.Data.Expressions.IQueryExpression<_SystemUserB>
    {
        #region Constructor (s) / Destructor
        /// <summary>
        /// Constructor (s) / Destructor.
        /// </summary>
        public _SystemUserB()
            : base("SystemUserB")
        {
        }
        #endregion
        #region Members
        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _UserID = "UserID";
        public RaisingStudio.Data.Expressions.ColumnExpression UserID { get { return _UserID; } }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _UserName = "UserName";
        public RaisingStudio.Data.Expressions.ColumnExpression UserName { get { return  _UserName;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _FullName = "FullName";
        public RaisingStudio.Data.Expressions.ColumnExpression FullName { get { return  _FullName;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _Password = "Password";
        public RaisingStudio.Data.Expressions.ColumnExpression Password { get { return  _Password;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _ChangingPassword = "ChangingPassword";
        public RaisingStudio.Data.Expressions.ColumnExpression ChangingPassword { get { return  _ChangingPassword;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _UserLocked = "UserLocked";
        public RaisingStudio.Data.Expressions.ColumnExpression UserLocked { get { return  _UserLocked;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _LastLogin = "LastLogin";
        public RaisingStudio.Data.Expressions.ColumnExpression LastLogin { get { return  _LastLogin;} }

        public static readonly RaisingStudio.Data.Expressions.ColumnExpression _UserDescription = "UserDescription";
        public RaisingStudio.Data.Expressions.ColumnExpression UserDescription { get { return _UserDescription; } }

		#endregion
        
        public static implicit operator RaisingStudio.Data.Expressions.ConditionExpression(_SystemUserB SystemUserB)
        {
            return new RaisingStudio.Data.Expressions.ConditionExpression();
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression)
        {
             RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
             return conditionExpression.OrderBy(columnExpression);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression OrderBy(RaisingStudio.Data.Expressions.ColumnExpression columnExpression, RaisingStudio.Data.Expressions.SortingDirection sortingDirection)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.OrderBy(columnExpression, sortingDirection);
        }

        public RaisingStudio.Data.Expressions.ConditionExpression Where(RaisingStudio.Data.Expressions.ExpressionElement expressionElement)
        {
            RaisingStudio.Data.Expressions.ConditionExpression conditionExpression = this;
            return conditionExpression.Where(expressionElement);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpressionCollection(_SystemUserB SystemUserB)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpressionCollection(SystemUserB);
        }

        public static implicit operator RaisingStudio.Data.Expressions.ColumnExpression[](_SystemUserB SystemUserB)
        {
            return new RaisingStudio.Data.Expressions.ColumnExpression[]
                        {                            
                            SystemUserB.UserID,
                            SystemUserB.UserName,
                            SystemUserB.FullName,
                            SystemUserB.Password,
                            SystemUserB.ChangingPassword,
                            SystemUserB.UserLocked,
                            SystemUserB.LastLogin,
                            SystemUserB.UserDescription,
                        };
        }

        public RaisingStudio.Data.Expressions.ColumnExpressionCollection Except(params RaisingStudio.Data.Expressions.ColumnExpression[] columns)
        {
            RaisingStudio.Data.Expressions.ColumnExpressionCollection columnExpressionCollection = this;
            return columnExpressionCollection.Except(columns);
        }


        public static implicit operator RaisingStudio.Data.Expressions.QueryExpression<_SystemUserB>(_SystemUserB SystemUserB)
        {
            return new RaisingStudio.Data.Expressions.QueryExpression<_SystemUserB>(SystemUserB);
        }


        #region IQueryExpression<_SystemUserB> 成员

        _SystemUserB RaisingStudio.Data.Expressions.IQueryExpression<_SystemUserB>.Value
        {
            get { return SystemUserB._; }
        }

        #endregion

        #region IQueryExpression 成员

        RaisingStudio.Data.Expressions.TableExpression RaisingStudio.Data.Expressions.IQueryExpression.Table
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ConditionExpression RaisingStudio.Data.Expressions.IQueryExpression.Condition
        {
            get { return this; }
        }

        RaisingStudio.Data.Expressions.ColumnExpressionCollection RaisingStudio.Data.Expressions.IQueryExpression.Columns
        {
            get { return null; }
        }

        #endregion
    }

    partial class SystemUserB
    {
        #region Members
        public static readonly _SystemUserB _ = new _SystemUserB();
		#endregion
    }
}
